﻿
<div>
    <form name="specialPersonCreateOrEditForm" role="form" novalidate class="form-validation">
        <div class="modal-header">
            <h4 class="modal-title">
                <span ng-if="vm.specialPerson.id">编辑信息:{{vm.specialPerson.name}}</span>
                <span ng-if="!vm.specialPerson.id">新增信息</span>
            </h4>
        </div>
        <div class="modal-body">

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Name" ng-class="{'edited':vm.specialPerson.name}" ng-model="vm.specialPerson.name" maxlength="50" required />
                <label>@L("Name")</label>
                <span class="help-block">     @L("Name")@L("MustBe_Required")</span>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="Phone" ng-class="{'edited':vm.specialPerson.phone}" ng-model="vm.specialPerson.phone" maxlength="11" required ng-pattern="/(^$)|^(((\+86)|(86))?1[34578]\d{9})$/" />
                <label>@L("Phone")</label>
                <span class="help-block" ng-show="specialPersonCreateOrEditForm.Phone.$error.required">     @L("Phone")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!specialPersonCreateOrEditForm.Phone.$error.required&&specialPersonCreateOrEditForm.Phone.$invalid">     @L("PleaseEnterTheCorrectType")@L("Phone")</span>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <input type="text" class="form-control" name="IDCard" ng-class="{'edited':vm.specialPerson.idCard}" ng-model="vm.specialPerson.idCard" maxlength="18" required ng-pattern="/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/" />
                <label>@L("IDCard")</label>
                <span class="help-block" ng-show="specialPersonCreateOrEditForm.IDCard.$error.required">     @L("IDCard")@L("MustBe_Required")</span>
                <span class="help-block" ng-show="!specialPersonCreateOrEditForm.IDCard.$error.required&&specialPersonCreateOrEditForm.IDCard.$invalid">     @L("PleaseEnterTheCorrectType")@L("IDCard")</span>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Sex" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.sex">
                    <option ng-repeat="x in vm.sexList" value="{{x.value}}" ng-selected="vm.specialPerson.sex==x.value">{{x.name}}</option>
                </select>
                <label>@L("Sex")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select chosen search_contains="true" name="Nation" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.nation">
                    <option ng-repeat="x in vm.disNationList" value="{{x.value}}" ng-selected="vm.specialPerson.nation==x.value">{{x.displayText}}</option>
                </select>
                <label>@L("Nation")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Health" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.health">
                    <option ng-repeat="x in vm.disHealthList" value="{{x.value}}" ng-selected="vm.specialPerson.health==x.value">{{x.displayText}}</option>
                </select>
                <label>@L("Health")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Politics" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.politics">
                    <option ng-repeat="x in vm.disPoliticsList" value="{{x.value}}" ng-selected="vm.specialPerson.politics==x.value">{{x.displayText}}</option>
                </select>
                <label>@L("Politics")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2">
                <select name="Culture" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.culture">
                    <option ng-repeat="x in vm.disCultureList" value="{{x.value}}" ng-selected="vm.specialPerson.culture==x.value">{{x.displayText}}</option>
                </select>
                <label>@L("Culture")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen2" ng-show="false">
                <select name="TownID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.personTypeID" required>
                    <option ng-repeat="x in vm.personTypeList" value="{{x.id}}" ng-selected="vm.specialPerson.personTypeID==x.id">{{x.name}}</option>
                </select>
                <label>@L("PersonTypeTitle")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="TownID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.townID" ng-change="vm.bindArea(vm.specialPerson.townID)" required>
                    <option ng-repeat="x in vm.townList" value="{{x.id}}" ng-selected="vm.specialPerson.townID==x.id">{{x.title}}</option>
                </select>
                <label>@L("TownID")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="AreaID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.areaID" ng-change="vm.bindVillage(vm.specialPerson.areaID)" required>
                    <option ng-repeat="x in vm.areaList" value="{{x.id}}" ng-selected="vm.specialPerson.areaID==x.id">{{x.title}}</option>
                </select>
                <label>@L("AreaID")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint mrshen3">
                <select name="VillageID" class="form-control edited ng-pristine ng-valid ng-not-empty ng-touched" ng-model="vm.specialPerson.villageID" required>
                    <option ng-repeat="x in vm.villageList" value="{{x.id}}" ng-selected="vm.specialPerson.villageID==x.id">{{x.title}}</option>
                </select>
                <label>@L("VillageID")</label>
            </div>
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" class="form-control" name="Address" ng-class="{'edited':vm.specialPerson.address}" ng-model="vm.specialPerson.address" maxlength="500" required />
                <label>@L("Address")</label>
                <span class="help-block">     @L("Address")@L("MustBe_Required")</span>
            </div>

        </div>
        <div class="modal-footer">
            <button ng-disabled="vm.saving" type="button" class="btn btn-default" ng-click="vm.cancel()">@L("Cancel")</button>
            <button type="submit" button-busy="vm.saving" busy-text="@L("SavingWithThreeDot")" class="btn btn-primary blue" ng-click="vm.save()" ng-disabled="specialPersonCreateOrEditForm.$invalid"><i class="fa fa-save"></i> <span>@L("Save")</span></button>
        </div>
    </form>
</div>